export const execCopy = (text:string)=> {
    const input = document.createElement('INPUT');
    input.style.opacity  = '0';
    input.style.position = 'absolute';
    input.style.top = '-1000px';
    document.body.appendChild(input);

    (input as HTMLInputElement).value = text;
    (input as HTMLInputElement).select();
    (input as HTMLInputElement).setSelectionRange(0, text.length);
    document.execCommand('copy');
    document.body.removeChild(input);
    return true;
}